#pragma once
#include "EventLoop.h"
#include "ThreadPool.h"

struct Listener
{
    int32_t lfd;
    uint16_t port;
};

struct TcpServer
{   
    int32_t threadNum;
    struct EventLoop *mainLoop;
    struct ThreadPool *threadPool;
    struct Listener *listener;
};

//初始化
struct TcpServer *tcpServerInit(uint16_t port, int32_t threadNum);
//初始化监听
struct Listener *listenerInit(uint16_t port);
//启动服务器
void tcpServerRun(struct TcpServer *server);